package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86136
 * Date: 2024-05-22
 * Time: 13:27
 */
public class Derievd extends Base{
    public int a = 1;
    public char b = 'b';
    public void fuc() {
        System.out.println("子类成员方法");
        System.out.println("子类a:"+this.a);
        System.out.println("子类b:"+this.b);//即使成员变量的类型不同，但子类和父类同名，也是访问子类的成员变量

        System.out.println("父类a:"+super.a);//在子类成员方法中访问父类成员变量

    }
}
